<?php
	include_once '../includes/header.php';	
	include_once '../includes/menu.php';
?>
<div id="content">
<h2> Lista de Funcion&aacute;rios</h2>

<a href="funcionarioIncluir.php" >Incluir Novo Funcion&aacute;rio</a>
<table id="example" class="display">
            <thead>
                <tr>
                	<th>Nome  </th>
                    <th>Login </th>
                    <th>Telefone</th>
                	<th>Email  </th>
                    <th>Nivel </th>
                    <th>Consultar</th>
                    <th>Editar</th>
                    <th>Excluir</th>
                
                </tr>
            </thead>
            <tbody>
            <?php
           	 	require_once '../classes/banco.class.php';
           	 	
           	 	$banco = new banco();
				$banco->conecta();
				
				$resultado=$banco->exSQL("SELECT p.id, p.nome,p.telefone1, p.email, l.login, l.nivel FROM Pessoa p INNER JOIN
											Login l ON p.id = l.pessoa_id where tipo_pessoa='funcionario'");
        		while($campo = mysql_fetch_array($resultado)){			
			?>
                    <tr>
                        <td>
                            <?php echo $campo['nome']; ?>
                        </td>
                        <td>
                            <?php echo $campo['login'];?>
                        </td>
                        <td>
                            <?php echo $campo['telefone1'];  ?>
                        </td>
                        <td>
                            <?php echo $campo['email']; ?>
                        </td>
                        <td>
                            <?php echo $campo['nivel'];
                            ?>
                        </td>  
                         <td>
                            <a  href="funcionarioConsultar.php?id=<?php echo $campo['id'];  ?>">
                            	  <img src="../assets/icones/consultar.png" /> 
                             </a>
                        <td>
                            <a href="funcionarioEditar.php?id=<?php echo $campo['id']; ?>">
                                  <img src="../assets/icones/editar.png" /> 
                            </a>
                        </td>
                        <td id="sidebar">
                            <a  href="funcionarioExcluir.php?id=<?php echo $campo['id'];  ?>">
                                <img src="../assets/icones/excluir.png" /> 
                            </a>
                        </td>
                    </tr>
                <?php }
                
	 ?>	
           			
			</tbody>
	</table>
</div>
	<?php	
	include_once '../includes/footer.php';
?>